package com.gxa.zhonglong.service.impl;

import com.gxa.zhonglong.mapper.GoodsMoneyMapper;
import com.gxa.zhonglong.pojo.GoodsMoney;
import com.gxa.zhonglong.service.GoodsMoneyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author wanjun
 * @version 1.0
 * @date 2021/11/1 15:43
 */
@Transactional(rollbackFor = Throwable.class)
@Service
public class GoodsMoneyServiceImpl implements GoodsMoneyService {
    @Autowired
    GoodsMoneyMapper goodsMoneyMapper=null;
    @Override
    public void insert(GoodsMoney goodsMoney) {
        goodsMoneyMapper.insert(goodsMoney);
    }

    @Override
    public void delete(List<Long> listId) {
        for (Long aLong : listId) {
            goodsMoneyMapper.delete(aLong);
        }
    }

    @Override
    public void update(GoodsMoney goodsMoney) {
         goodsMoneyMapper.update(goodsMoney);
    }

    @Override
    public List<GoodsMoney> selectAll() {
        return goodsMoneyMapper.selectAll();
    }
}
